package com.cqwshzj.framework.service.model;/**
 * @Description:
 * @Auther: Huang Zhijin
 * @Version: 1.0.0
 * @Date: 2021/4/7 10:49
 */

import com.cqwshzj.common.JobConstant;
import com.cqwshzj.framework.dao.model.JobInfo;
import com.cqwshzj.util.HzjBeanUtil;
import com.dangdang.ddframe.job.api.simple.SimpleJob;

import java.util.Map;

/**
 *
 * 〈〉
 *
 * @author Huang Zhijin
 * @create 2021/4/7
 * @since 1.0.0
 */
public class AddJobParam {

	//-----------------

	private String jobName;

	private Class<? extends SimpleJob> simpleJobClass;

	private String cron;

	private short shardingTotalCount;

	private String shardingItemParameters;

	//-----------------

	private String jobId;

	private String parentJobId;

	private Integer strategyId;

	private Integer jobType;

	private String occurdate;

	private Map<String, Object> params;


	//-------------------

	private String add2ElasticJob = JobConstant.COMMON_NO ;

	//--------------------------
	public JobInfo toJobInfo(){
		JobInfo jobInfo = new JobInfo();
		HzjBeanUtil.copyPropertiesIfNotNull( this, jobInfo );
		jobInfo.setId( jobId );
		jobInfo.setStrtId( strategyId );
		return jobInfo;
	}

	//--------------------------

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public Class<? extends SimpleJob> getSimpleJobClass() {
		return simpleJobClass;
	}

	public void setSimpleJobClass(Class<? extends SimpleJob> simpleJobClass) {
		this.simpleJobClass = simpleJobClass;
	}

	public String getCron() {
		return cron;
	}

	public void setCron(String cron) {
		this.cron = cron;
	}

	public short getShardingTotalCount() {
		return shardingTotalCount;
	}

	public void setShardingTotalCount(short shardingTotalCount) {
		this.shardingTotalCount = shardingTotalCount;
	}

	public String getShardingItemParameters() {
		return shardingItemParameters;
	}

	public void setShardingItemParameters(String shardingItemParameters) {
		this.shardingItemParameters = shardingItemParameters;
	}

	public String getJobId() {
		return jobId;
	}

	public void setJobId(String jobId) {
		this.jobId = jobId;
	}

	public String getParentJobId() {
		return parentJobId;
	}

	public void setParentJobId(String parentJobId) {
		this.parentJobId = parentJobId;
	}

	public Integer getStrategyId() {
		return strategyId;
	}

	public void setStrategyId(Integer strategyId) {
		this.strategyId = strategyId;
	}

	public Integer getJobType() {
		return jobType;
	}

	public void setJobType(Integer jobType) {
		this.jobType = jobType;
	}

	public String getOccurdate() {
		return occurdate;
	}

	public void setOccurdate(String occurdate) {
		this.occurdate = occurdate;
	}

	public Map<String, Object> getParams() {
		return params;
	}

	public void setParams(Map<String, Object> params) {
		this.params = params;
	}

	public String getAdd2ElasticJob() {
		return add2ElasticJob;
	}

	public void setAdd2ElasticJob(String add2ElasticJob) {
		this.add2ElasticJob = add2ElasticJob;
	}
}
